import request from '@/router/axios';

//获取模糊查询下拉列表
export const searchList = (str) => {
  return request({
    url: `/api/blade-hg/query/datainit?str=${str}`,
    method: 'get'
  })
}
//获取输入框
export const getInput = (basename) => {
  return request({
    url: `/api/blade-hg/query/condition?queryType=1&basename=${basename} `,
    method: 'get'
  })
}
//获取查询列表
export const getList = (formData) => {
  return request({
    url: '/api/blade-hg/home/search',
    method: 'post',
    headers: {
      "Content-Type": "multipart/form-data"
    },
    data:formData
  })
}
//查询详情
export const getDetail = (formData) => {
  return request({
    url: '/api/blade-hg/home/details',
    method: 'post',
    headers: {
      "Content-Type": "multipart/form-data"
    },
    data:formData
  })
}
//下载
export const downLoad = (data) => {
  return request({
    url: `/api/blade-hg/query/preDownload?basename=${data.basename}&ids=${data.ids}&page=${data.page}&n=${data.n}`,
    method: 'post'
  })
}
export const downLoadAll = (data) => {
  return request({
    url: `/api/blade-hg/query/download?basename=${data.basename}&ids=${data.ids}&page=${data.page}&n=${data.n}&count=${data.count}`,
    method: 'post'
  })
}
export const getScrollList = (month,key) => {
  return request({
    url: `/api/blade-hg/headroll?month=${month}&key=${key}`,
    method: 'get'
  })
}

// 获取图表的接口 （可分页）
export const getData = (data) => {
  return request({
    url: '/api/blade-hg/hgStatistics/chart',
    method: 'post',
    data: data
  })
}

//   另一种图表（美国单独处理）
export const getUsaData = (chartType) => {
  return request({
    url: '/api/blade-hg/rChart/usa',
    method: 'get',
    params: {
      chartType
    }
  })
}
// 获取供应商
export const usaShippername = (consigneename) => {
  return request({
    url: '/api/blade-hg/rChart/usa/chartType3',
    method: 'get',
    params: {
      consigneename: consigneename == '全部' ? '' : consigneename
    }
  })
}

// 获取供应商
export const getMOnthData = (data) => {
  return request({
    url: '/api/blade-hg/hgStatistics/analysis',
    method: 'post',
    data
  })
}

// 获取tname
export const getTname = (data) => {
  return request({
    url: '/api/blade-hg/hgStatistics/tname',
    method: 'post',
    data
  })
}


// 获取查询海关时间
export const getTime = () => {
  return request({
    url: '/api/blade-hg/query/restTime',
    method: 'post',
    parsms:{
      queryType: 1
    }
  })
}

// 查询是否有海关权限
export const haveJurisdiction = () => {
  return request({
    url: '/api/blade-data/select/Check',
    method: 'get'
  })
}

// 获取海关cookie
export const getCookie = () => {
  return request({
    // url: `/api/blade-data/select/show?Blade-Auth=${token}`,
    url:'/api/blade-data/select/DataServlet',
    method: 'get'
  })
}

